<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="/oa/Public/js/jquery.js"></script>
<script type="text/javascript" src="/oa/Public/js/common.js"></script>
<link rel="stylesheet" type="text/css" href="/oa/Public/css/global.css" />
<link rel="stylesheet" type="text/css" href="/oa/Public/css/form.css" />
</head>
<body>
<div class="search">
	<input type="button" value="添加" class="button" onclick="add()" >
</div>
<div class="list">
<table class="stripe" cellspacing="0">
    <thead>
        <tr>
        	<th style="min-width: 30px;"><input type="checkbox" name="checkid" onclick="if(this.checked==true) { checkAll('key[]'); } else { clearAll('key[]'); }" ></th>
            <th width="60%">标题</th>
            <th width="12%">发送人</th>
            <th width="12%">时间</th>
            <th width="14%">操作</th>
        </tr>
    </thead>
 
    <tbody>
    <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <td><input type="checkbox" name="key[]" value="<?php echo ($vo["id"]); ?>"></td>
            <td><a href="javascript:void(0);" onclick="view(<?php echo ($vo["id"]); ?>);"><?php echo ($vo["title"]); ?></a></td>
            <td><?php echo ($vo["author"]); ?></td>
            <td><?php echo (mb_substr($vo["create_time"],0,10,'utf-8')); ?></td>
            <td><a href="javascript:void(0);" onclick="edit(<?php echo ($vo["id"]); ?>)" title="编辑">编辑</a>&nbsp;|&nbsp;<a href="javascript:void(0);" onclick="del(<?php echo ($vo["id"]); ?>)" title="删除">删除</a></td>
        </tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>
    </tbody>
</table>
</div>
<div class="page"><?php echo ($page); ?></div>
</body>
</html>
<script language="javascript">
$(document).ready(function(){  
	$(".stripe tr").mouseover(function(){    
	  $(this).addClass("over");}).mouseout(function(){   
			$(this).removeClass("over");}) 
  	$(".stripe tr:even").addClass("alt");
});   
function view(id){
	window.location="/oa/index.php/Circular/view?id="+id;
}

function edit(id){
	window.location="/oa/index.php/Circular/edit?id="+id;
}

function add(){
	window.location="/oa/index.php/Circular/add";
}

function del(id) {
	if (confirm("真的要删除吗？")){
		$.get("/oa/index.php/Circular/delete?id="+id, function(result){
			location.reload();
		});
	}else{
		return false;
	}
}
</script>